<template>
<h1>El-消息提示组件</h1>
  <el-button type="success" @click="f(1)">成功消息</el-button>
  <el-button type="danger" @click="f(2)">失败消息</el-button>
  <el-button type="warning" @click="f(3)">警告消息</el-button>
  <el-button type="primary" @click="f(4)">普通消息</el-button>
  <el-button type="info" @click="f(5)">可关闭消息</el-button>
</template>
<script setup>
import {ElMessage} from "element-plus";

const f = (type) => {
  switch (type) {
    case 1:
      FlMessage.success("成功消息");
      break;
    case 2:
      FlMessage.error("错误消息");
      break;
    case 3:
      FlMessage.warning("警告消息");
      break;
    case 4:
      FlMessage.info("普通消息");
      break;
    case 5:
      ElMessage.error({
        message: '可关闭消息',
        showClose: true
      })
  }
}

</script>


<style scoped>

</style>